import java.sql.*;

public class opening {

 static Connection con = null;
 static Statement stmt = null;
 static ResultSet rs = null;

  public static void main(String args[]){

   /* try {
     Class.forName( "com.mysql.jdbc.Driver" );
    }
    catch ( ClassNotFoundException e ) {
      e.printStackTrace();
      System.exit(1);
    }
*/
    try{
      con = DriverManager.getConnection("jdbc:mysql://localhost/tma_entwurf;shutdown=true","sa","");

      stmt = con.createStatement();

      rs = stmt.executeQuery("SELECT nr,name,sonstiges FROM TEST_TABELLE");

      while ( rs.next() ){
        System.out.println("Nr:                "+rs.getString(1));
        System.out.println("Name:           "+rs.getString(2));
        System.out.println("Sonstiges:      "+rs.getString(3));
      }

      rs.close();
      stmt.close();
      con.close();
    }

    catch ( SQLException e ){
     e.printStackTrace();
      System.exit(1);
    }

  }
}